import request from '@/utils/request.js'


// 分页图片获取
export function allpaper(current,size,sort,type) {
  return request({
    url: '/image/pageList',
    method: 'get',
    params: {
      current,
      size,
      sort,
      type
    }
  })
}

// 分类信息
export function typelist() {
  return request({
    url: '/type/list',
    method:'get'
  })
}

// 下载图片
export function imgdown(id) {
  return request({
    url: `/image/download/${id}`,
   responseType:'blob'

  })
}
// 收藏图片
export function imgcoll(ids) {
  return request({
    url: `/collect/love/${ids}`,
    method:'post'
  })
}
//
// 用户收藏图片
export function userCollImg(current,size) {
  return request({
    url: '/collect/page',
    params: {
      current,
      size
    }
  
  })
}

// 用户搜索图片
export function searchImg({current,name,size}) {
  return request({
    url: '/image/getByName',
    params: {
      current,
      size,
      name
    }
  
  })
}